<?php
/**
 * Created by PhpStorm.
 * User: liuchaozhong
 * Date: 2018/8/23
 * Time: 下午5:04
 */
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Collect extends Model
{
    protected $table = 'collection';
    public $fillable = ['member_id','article_id'];

    //关联收藏用户
    public function g_member()
    {
        return $this->belongsTo(Member::class, 'member_id');
    }

    //关联文章
    public function g_article()
    {
        return $this->belongsTo(Article::class, 'article_id');
    }

}